Etherscan V2 workaround - #2679
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2679 +/- ##
=======================================
Coverage 35.37% 35.37%
=======================================
Files 112 112
Lines 5331 5331
Branches 1412 1412
=======================================
Hits 1886 1886
Misses 3444 3444
Partials 1 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
naddison36
left a comment
There was a problem hiding this comment.
Not great that hardhat-etherscan no longer works but it'll have to do for now. hardhat-verify works but it a pain when there are constructor parameters. It's manageable, though.
| ``` | ||
| npx hardhat --network mainnet verify --contract contracts/vault/VaultAdmin.sol:VaultAdmin 0x31a91336414d3B955E494E7d485a6B06b55FC8fB | ||
| ``` | ||
|
|
There was a problem hiding this comment.
Can we add an example with a constructor parameter. This one is from the deployment template in Notion
echo "module.exports = [{
platformAddress: \"0x0000000000000000000000000000000000000001\",
vaultAddress: \"0xe75d77b1865ae93c7eaa3040b038d7aa7bc02f70\",
}]" > flux-args.js
npx hardhat --network mainnet verify --contract contracts/strategies/FluxStrategy.sol:FluxStrategy --constructor-args flux-args.js 0x57d49c28Cf9A0f65B1279a97eD01C3e49a5A173f
There was a problem hiding this comment.
good point thanks added here: https://github.com/OriginProtocol/origin-dollar/pull/2679/commits
279bfaa
Etherscan has migrated to V2 api for the contract verification. There are guides on how to migrate, but I couldn't get a workable combination of packages. Increasing some of the versions also introduces great breaking changes.
This PR finds a workaround on how to verify contracts by forcing a V2 api with the necessary
chainIdget parameter without any changes to the installed packages